import './index.scss'

import 'element/components/area'
import 'element/components/text'
import 'element/components/line'

import { PEShadowElement, register } from 'element/share/element'

import style from '-!to-string-loader!postcss-loader!sass-loader!./demo/shadow.scss'
import html from '-!html-loader!./demo/shadow.html'

class PEDemoElement extends PEShadowElement {
  static nodeName = 'pe-demo'

  constructor() {
    super()
    this.shadow.innerHTML = `<style>${style}</style>${html}`
  }

  connected() {
    // const fra = document.createDocumentFragment()
    // Array.from(this.queryAll('p')).forEach((p) => {
    //   const a = document.createElement('a')
    //   a.href = `#${p.id}`
    //   a.innerText = ` ${p.id} `
    //   fra.appendChild(a)
    // })
    // this.parentNode?.insertBefore(fra, this)
    // document.body.appendChild(this.query('.root') as Element)
  }
}

register(PEDemoElement, [])
